package com.xmh.reptile.action;

import java.util.Date;

public class Result {

    private Integer code;

    private String message;

    private Date timestamp;

    private Object data;

    private Exception error;

    public Result(Object data) {
        this.data = data;
        this.code = 200;
        this.timestamp = new Date();
    }

    public Result(Integer code, Object data) {
        this.code = code;
        this.data = data;
        this.timestamp = new Date();
    }

    public Result(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
        this.timestamp = new Date();
    }

    public Result(Integer code, String message, String path, Date timestamp, Object data, Exception error) {
        this.code = code;
        this.message = message;
        this.timestamp = timestamp;
        this.data = data;
        this.error = error;
    }
}